/*** 
 * 个人出勤率
 * ***/
echarts.init(document.getElementById("personal")).setOption({
	title: {
		text: '个人出勤率统计',
		x: 'center',
		y: '10%'
	},
	tooltip: {
		trigger: 'item',
		formatter: "{a} <br/>{b} : {c} ({d}%)"
	},
	legend: {
		orient: 'vertical',
		x: '5%',
		y: '10%',
		data: ['出勤', '未出勤']
	},
	calculable: true,
	series: [{
		name: '个人出勤率',
		type: 'pie',
		radius: '55%',
		center: ['50%', '60%'],
		data: [{
				value: 9,
				name: '出勤'
			},
			{
				value: 1,
				name: '未出勤'
			}
		]
	}]
});

/***
 * 班级出勤率
 * ***/
echarts.init(document.getElementById("class")).setOption({
	title: {
		text: '班级出勤率统计',
		x: 'center',
		y: '5%'
	},
	tooltip: {
		trigger: 'axis'
	},
	legend: {
		x: '10%',
		y: '5%',
		data: ['出勤人数', '未出勤人数']
	},
	calculable: true,
	xAxis: [{
		type: 'category',
		data: ['1班', '2班', '3班', '4班', '5班', '6班', '7班', '8班', '9班', '10班', '11班', '12班']
	}],
	yAxis: [{
		type: 'value'
	}],
	series: [{
			name: '出勤人数',
			type: 'bar',
			data: [50, 45, 52, 48, 55, 45, 48, 49, 50, 40, 47, 51],
			markLine: {
				data: [{
					type: 'average',
					name: '平均值出勤人数'
				}]
			}
		},
		{
			name: '未出勤人数',
			type: 'bar',
			data: [1, 5, 0, 0, 0, 6, 3, 4, 0, 10, 2, 0],
			markLine: {
				data: [{
					type: 'average',
					name: '平均值未出勤人数'
				}]
			}
		}
	]
});

/***
 * 辅导员出勤率
 * ***/
echarts.init(document.getElementById("instructor")).setOption({
	title: {
		text: '辅导员出勤率统计',
		x: 'center',
		y: '3%'
	},
	tooltip: {
		trigger: 'axis'
	},
	legend: {
		x: 'center',
		y: '9%',
		data: ['出勤率', '未出勤率']
	},
	calculable: true,
	xAxis: [{
		type: 'category',
		data: ['王芳', '胡宝', '渝旋', '余巧', '易华琴']
	}],
	yAxis: [{
		type: 'value'
	}],
	series: [{
			name: '出勤率',
			type: 'bar',
			data: [95, 97, 99, 100, 96],
			markLine: {
				data: [{
					type: 'average',
					name: '平均值出勤率'
				}]
			}
		},
		{
			name: '未出勤率',
			type: 'bar',
			data: [5, 3, 1, 0, 4],
			markLine: {
				data: [{
					type: 'average',
					name: '平均值未出勤率'
				}]
			}
		}
	]
});

/***
 * 学院出勤率
 * ***/
echarts.init(document.getElementById("faculty")).setOption({
	title: {
		text: '学院出勤率统计',
		x: 'center',
		y: '3%'
	},
	tooltip: {
		trigger: 'axis'
	},
	legend: {
		x: 'center',
		y: '9%',
		data: ['出勤率', '未出勤率']
	},
	calculable: true,
	xAxis: [{
		type: 'category',
		data: ['大一', '大二', '大三', '大四']
	}],
	yAxis: [{
		type: 'value'
	}],
	series: [{
		name: '出勤率',
		type: 'bar',
		data: [99, 97, 99, 95],
		markLine: {
			data: [{
				type: 'average',
				name: '平均值出勤率'
			}]
		}
	}]
});

/*** 
 * 活动类型
 * ***/
echarts.init(document.getElementById("type")).setOption({
	title: {
		text: '活动类型统计',
		x: 'center',
		y: '10%'
	},
	tooltip: {
		trigger: 'item',
		formatter: "{a} <br/>{b} : {c} ({d}%)"
	},
	legend: {
		orient: 'vertical',
		x: '5%',
		y: '10%',
		data: ['会议', '活动', '课程']
	},
	calculable: true,
	series: [{
		name: '活动类型统计',
		type: 'pie',
		radius: '55%',
		center: ['50%', '60%'],
		data: [{
				value: 51,
				name: '会议'
			},
			{
				value: 40,
				name: '活动'
			},
			{
				value: 32,
				name: '课程'
			}
		]
	}]
});

/*** 
 * 周出勤率
 * ***/
echarts.init(document.getElementById("week")).setOption({
	title: {
		text: '周出勤率统计',
		x: 'center',
		y: '10%'
	},
	tooltip: {
		trigger: 'item',
		formatter: "{a} <br/>{b} : {c} ({d}%)"
	},
	legend: {
		orient: 'vertical',
		x: '5%',
		y: '10%',
		data: ['出勤', '未出勤']
	},
	calculable: true,
	series: [{
		name: '周出勤率',
		type: 'pie',
		radius: '55%',
		center: ['50%', '60%'],
		data: [{
				value: 1005,
				name: '出勤'
			},
			{
				value: 10,
				name: '未出勤'
			}
		]
	}]
});

/*** 
 * 月出勤率
 * ***/
echarts.init(document.getElementById("month")).setOption({
	title: {
		text: '月出勤率统计',
		x: 'center',
		y: '10%'
	},
	tooltip: {
		trigger: 'item',
		formatter: "{a} <br/>{b} : {c} ({d}%)"
	},
	legend: {
		orient: 'vertical',
		x: '5%',
		y: '10%',
		data: ['出勤', '未出勤']
	},
	calculable: true,
	series: [{
		name: '月出勤率',
		type: 'pie',
		radius: '55%',
		center: ['50%', '60%'],
		data: [{
				value: 1005,
				name: '出勤'
			},
			{
				value: 5,
				name: '未出勤'
			}
		]
	}]
});